package com.manager.base.controllers;


import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import java.io.IOException;

/**
 * Created by apple on 2017/12/12.
 */
@Controller
public class PageController {

    /**
     * 动态地址，免登录
     * @param request
     * @return
     * @throws IOException
     */
    @RequestMapping(value = {"**/{page}.html"})
    public ModelAndView mobile(HttpServletRequest request ) throws IOException {
        String viewName = request.getRequestURI().toString().substring((request.getContextPath().toString()).length());

        ModelAndView view = new ModelAndView() ;
        view.setViewName(viewName.replace(".html", ""));
        return view;
    }
}